﻿@{
    ViewBag.PageTitle = "会员中心 - " + ViewBag.site.SeoTitle;
    ViewBag.PageKeyword = ViewBag.site.SeoKeyword;
    ViewBag.PageDescription = ViewBag.site.SeoDescription;
}
<div class="wrapper">
    <div class="account-box">
        @{
            await Html.RenderPartialAsync("_AccountNav");
        }
        <div class="index-box">
            <div class="info-index">
                <div class="avatar-box">
                    <div class="img-box">
                        <el-image v-if="account.avatar" :src="common.loadFile(account.avatar)"></el-image>
                        <span v-else class="icon iconfont icon-user-full"></span>
                        <a href="/account/setting/info" class="edit">
                            <span class="icon iconfont icon-edit"></span>
                        </a>
                    </div>
                    <div class="txt-box">
                        <div class="item-box">
                            <span class="title">{{account.userName}}</span>
                        </div>
                        <div class="item-box">
                            <span class="text">用户组</span>
                            <span class="title">{{account.groupTitle}}</span>
                        </div>
                        <div class="item-box">
                            <span class="text">手机</span>
                            <span class="title">{{account.phone}}</span>
                        </div>
                        <div class="item-box">
                            <span class="text">注册时间</span>
                            <span class="title">{{account.regTime}}</span>
                        </div>
                    </div>
                </div>

                <div class="num-box">
                    <span class="num">{{account.amount}}</span>
                    <span class="text">账户余额</span>
                </div>
                <div class="num-box">
                    <span class="num">{{account.point}}</span>
                    <span class="text">账户积分</span>
                </div>

            </div>

            <div class="list-wrap">
                <div class="section-box">
                    <div class="title">
                        <span>账户充值</span>
                    </div>
                    <div class="content">
                        <div v-if="rechargeList.length===0" class="nodata">
                            <span class="icon iconfont icon-msg"></span>
                            <span class="text">暂无需付款记录</span>
                        </div>
                        <div class="txt-list">
                            <div v-for="(item,index) in rechargeList" :key="index" class="list-box">
                                <div class="left">
                                    <h5>{{item.rechargeNo}}</h5>
                                    <span class="time iconfont icon-time">{{item.addTime}}</span>
                                </div>
                                <div class="right">
                                    <el-button type="success" size="mini" @@click="common.linkUrl('/payment/confirm?no='+item.rechargeNo)">去付款</el-button>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="section-box">
                    <div class="title">
                        <span>余额记录</span>
                    </div>
                    <div class="content">
                        <div v-if="rechargeList.length===0" class="nodata">
                            <span class="icon iconfont icon-msg"></span>
                            <span class="text">暂无余额记录</span>
                        </div>
                        <div class="txt-list">
                            <div v-for="(item,index) in amountList" :key="index" class="list-box">
                                <div class="left">
                                    <h5>{{item.remark}}</h5>
                                    <span class="time iconfont icon-time">{{item.addTime}}</span>
                                </div>
                                <div class="right">
                                    <el-tag v-if="item.value>=0" size="small" type="danger">+{{item.value}}元</el-tag>
                                    <el-tag v-if="item.value<0" size="small" type="danger">{{item.value}}元</el-tag>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="section-box">
                    <div class="title">
                        <span>积分记录</span>
                    </div>
                    <div class="content">
                        <div v-if="rechargeList.length===0" class="nodata">
                            <span class="icon iconfont icon-msg"></span>
                            <span class="text">暂无积分记录</span>
                        </div>
                        <div class="txt-list">
                            <div v-for="(item,index) in pointList" :key="index" class="list-box">
                                <div class="left">
                                    <h5>{{item.remark}}</h5>
                                    <span class="time iconfont icon-time">{{item.addTime}}</span>
                                </div>
                                <div class="right">
                                    <el-tag v-if="item.value>=0" size="small" type="danger">+{{item.value}}分</el-tag>
                                    <el-tag v-if="item.value<0" size="small" type="danger">{{item.value}}分</el-tag>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
                <div class="section-box">
                    <div class="title">
                        <span>我的投稿</span>
                    </div>
                    <div class="content">
                        <div v-if="contributeList.length===0" class="nodata">
                            <span class="icon iconfont icon-msg"></span>
                            <span class="text">暂无需投搞记录</span>
                        </div>
                        <div class="txt-list">
                            <div v-for="(item,index) in contributeList" :key="index" class="list-box">
                                <div class="left">
                                    <h5>{{item.title}}</h5>
                                    <span class="time iconfont icon-time">{{item.addTime}}</span>
                                </div>
                                <div class="right">
                                    <el-tag v-if="item.status===0" type="danger" size="small">待处理</el-tag>
                                    <el-tag v-if="item.status===1" type="success" size="small">已通过</el-tag>
                                    <el-tag v-if="item.status===2" type="info" size="small">已退回</el-tag>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
@section Scripts{
    <script>
	//初始化VUE
	var ve = new Vue({
		el: '#app',
		data: {
            account: {}, //会员信息
            amountList: [], //余额记录
            pointList: [], //积分记录
            rechargeList: [], //待付款充值
            contributeList: [], //最新投搞
		},
		methods: {
			//初始化数据
			async initData(){
                let _this = this;
                //获取付款充值
                AxiosAjax({
                    url: `/account/recharge/view/4?status=0`,
                    success: function (res) {
                        _this.rechargeList = res.data;
                    }
                });
                //余额记录
                AxiosAjax({
                    url: `/account/amount/view/4`,
                    success: function (res) {
                        _this.amountList = res.data;
                    }
                });
                //积分记录
                AxiosAjax({
                    url: `/account/point/view/4`,
                    success: function (res) {
                        _this.pointList = res.data;
                    }
                });
                //获取投搞列表
                AxiosAjax({
                    url: `/client/article/contribute/view/4`,
                    success: function (res) {
                        _this.contributeList = res.data;
                    }
                });
				//获取会员信息
				await AxiosAjax({
					url: `/account/member`,
					success: function (res) {
                        _this.account = res.data;
					}
				});
			},
		},
		created() {
			this.initData();
		}
	})
    </script>
}